import React from 'react';
import PropTypes from 'prop-types';
import { Icon } from 'antd';

const SVGIcon = (props) => {
  const newProps = { ...props };
  newProps.type = require(`assets/icons/${props.type}.svg`);
  return (<Icon {...newProps} />);
};

SVGIcon.propTypes = {
  type: PropTypes.string.isRequired
};

export default SVGIcon;
